package com.lg.spring.config;

import com.lg.spring.filter.MyFilter;
import org.springframework.boot.web.servlet.FilterRegistrationBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @author by Mr. Li 2020/9/16 15:37
 */
@Configuration
public class MyFilterRegistrationConfig {

	@Bean
	public FilterRegistrationBean filterRegistrationBean() {
		FilterRegistrationBean filterRegistrationBean = new FilterRegistrationBean();

		filterRegistrationBean.addUrlPatterns("/myServlet/*");
		filterRegistrationBean.setFilter(new MyFilter());

		return filterRegistrationBean;
	}

}
